# Generated manually to create recipe models

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('main', '0007_add_fooditem_created_by'),
    ]

    operations = [
        migrations.CreateModel(
            name='Recipe',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='菜品名称')),
                ('description', models.TextField(blank=True, verbose_name='菜品描述')),
                ('difficulty', models.CharField(choices=[('easy', '简单'), ('medium', '中等'), ('hard', '困难')], default='medium', max_length=10, verbose_name='难度')),
                ('cooking_time', models.CharField(choices=[('15', '15分钟以内'), ('30', '30分钟以内'), ('60', '1小时以内'), ('120', '2小时以内'), ('240', '4小时以内')], default='30', max_length=10, verbose_name='制作时间')),
                ('servings', models.PositiveIntegerField(default=2, verbose_name='份数')),
                ('image', models.ImageField(blank=True, null=True, upload_to='recipe_images/', verbose_name='菜品图片')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.foodcategory', verbose_name='菜品分类')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='创建者')),
            ],
            options={
                'verbose_name': '做菜指南',
                'verbose_name_plural': '做菜指南',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='RecipeIngredient',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='食材名称')),
                ('amount', models.CharField(max_length=50, verbose_name='用量')),
                ('unit', models.CharField(choices=[('g', '克'), ('kg', '千克'), ('ml', '毫升'), ('l', '升'), ('个', '个'), ('根', '根'), ('片', '片'), ('瓣', '瓣'), ('勺', '勺'), ('茶匙', '茶匙'), ('汤匙', '汤匙'), ('杯', '杯'), ('适量', '适量')], default='适量', max_length=10, verbose_name='单位')),
                ('notes', models.CharField(blank=True, max_length=200, verbose_name='备注')),
                ('order', models.PositiveIntegerField(default=0, verbose_name='排序')),
                ('recipe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ingredients', to='main.recipe', verbose_name='菜品')),
            ],
            options={
                'verbose_name': '菜品食材',
                'verbose_name_plural': '菜品食材',
                'ordering': ['order', 'id'],
            },
        ),
        migrations.CreateModel(
            name='RecipeStep',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('step_number', models.PositiveIntegerField(verbose_name='步骤序号')),
                ('title', models.CharField(max_length=200, verbose_name='步骤标题')),
                ('description', models.TextField(verbose_name='步骤描述')),
                ('cooking_time', models.CharField(blank=True, max_length=50, verbose_name='此步骤用时')),
                ('heat_level', models.CharField(blank=True, max_length=50, verbose_name='火候')),
                ('image', models.ImageField(blank=True, null=True, upload_to='recipe_step_images/', verbose_name='步骤图片')),
                ('tips', models.TextField(blank=True, verbose_name='小贴士')),
                ('recipe', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='steps', to='main.recipe', verbose_name='菜品')),
            ],
            options={
                'verbose_name': '制作步骤',
                'verbose_name_plural': '制作步骤',
                'ordering': ['step_number'],
            },
        ),
        migrations.AddField(
            model_name='recipe',
            name='tags',
            field=models.ManyToManyField(blank=True, to='main.tag', verbose_name='相关标签'),
        ),
    ]

